package com.vorli;

import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class RadioButtonListener implements OnCheckedChangeListener {
	eggcalc egg;
	int type;
	
	public RadioButtonListener(eggcalc egg,int type) {
		super();
		this.egg = egg;
		this.type = type;
	}

	@Override
	public void onCheckedChanged(RadioGroup group, int checkedId) {
		
		RadioButton rb = (RadioButton) group.findViewById(checkedId);
		
		switch(this.type) {
		case 1:
			this.egg.setEggsize(Integer.valueOf(rb.getHint().toString()));
		case 2:
			this.egg.setEggtemp(Integer.valueOf(rb.getHint().toString()));
		case 3:
			this.egg.setEgginnen(Integer.valueOf(rb.getHint().toString()));
		}
		egg.calckochmin();
	}
		
}
